<template>
  <div class="boxs">
    <div class="boxs-top">
      <div class="title-left-style">
        <titles :title="props.info.text" />
      </div>
      <textMax :data="props.info.remarks" :maxLen="80" />
    </div>
    <div>
      <div class="img-box-item">
        <div class="box-left">
          <div class="item-left-shadow" @click="pathChild(props.info.children[0])">
            <span
              class="titles"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[0].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[0].remarks }}</span
            >
          </div>
          <img
            @click="pathChild(props.info.children[0])"
            class="item-left"
            :src="urls + props.info.children[0].value + '?imageView2/1/w/480/h/508/format/webp'"
            alt=""
            v-if="props.info.children[0].value"
          />

          <img
            @click="pathChild(props.info.children[0])"
            class="item-left"
            src="http://101.34.143.36:8890/api/image/387939155165253/h_508,w_480"
            alt=""
            v-else
          />
        </div>

        <div class="box-right">
          <div class="img-box">
            <div class="img-box-items">
              <div class="item-left-p-shadow" @click="pathChild(props.info.children[1])">
                <span
                  class="titles"
                  :style="{
                    fontSize: store.styleInfo.mintitleSize,
                    fontFamily: store.styleInfo.textFamily,
                    color: '#fff',
                  }"
                  >{{ props.info.children[1].text }}</span
                >
                <span
                  class="left-title1"
                  :style="{
                    fontSize: store.styleInfo.contentSize,
                    fontFamily: store.styleInfo.textFamily,
                    color: '#fff',
                  }"
                  >{{ props.info.children[1].remarks }}</span
                >
              </div>

              <img
                @click="pathChild(props.info.children[1])"
                :src="urls + props.info.children[1].value + '?imageView2/1/w/680/h/244/format/webp'"
                alt=""
                v-if="props.info.children[1].value"
              />

              <img
                @click="pathChild(props.info.children[1])"
                src="http://101.34.143.36:8890/api/image/387939155165253/h_244,w_680"
                alt=""
                v-else
              />
            </div>
            <div class="img-box-items">
              <div class="item-left-p-shadow" @click="pathChild(props.info.children[2])">
                <span
                  class="titles"
                  :style="{
                    fontSize: store.styleInfo.mintitleSize,
                    fontFamily: store.styleInfo.textFamily,
                    color: '#fff',
                  }"
                  >{{ props.info.children[2].text }}</span
                >
                <span
                  class="left-title1"
                  :style="{
                    fontSize: store.styleInfo.contentSize,
                    fontFamily: store.styleInfo.textFamily,
                    color: '#fff',
                  }"
                  >{{ props.info.children[2].remarks }}</span
                >
              </div>
              <img
                @click="pathChild(props.info.children[2])"
                :src="urls + props.info.children[2].value + '?imageView2/1/w/680/h/244/format/webp'"
                alt=""
                v-if="props.info.children[2].value"
              />

              <img
                @click="pathChild(props.info.children[2])"
                src="http://101.34.143.36:8890/api/image/387939155165253/h_244,w_680"
                alt=""
                v-else
              />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { onMounted } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
import UnitImageNull from '@/components/unitImageNull/unitImageNull.vue';
const router = useRouter();
const route = useRoute();
const props = defineProps({
  info: {
    type: Object,
  },
});
const store = useProjectStore();
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    name: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: {},
  });
};
</script>

<style lang="less" scoped>
@import './index.less';
.boxs-top {
  display: flex;
  flex-direction: column;
  align-items: left;
}
.boxs-content {
  width: 100%;
  display: flex;
}
.left-img {
  width: 100%;
  height: 508px;
}
.img-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 508px;
  .img-box-items {
    position: relative;
    width: 100%;
    height: 244px;
    img {
      width: 100%;
      height: 244px;
    }
  }
}
.left-title {
  margin-bottom: 50px;
}
.img-box-item {
  width: 100%;
  display: flex;
}
.box-left {
  position: relative;
  width: 480px;
  height: 508px;
  margin-right: 20px;
}

.item-left-shadow {
  position: absolute;
  z-index: 99;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 109;
  padding: 24px 96px;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  .titles {
    margin-bottom: 32px;
  }
}
.item-left-p-shadow {
  position: absolute;
  z-index: 99;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 109;
  padding: 60px 132px;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  .titles {
    margin-bottom: 32px;
  }
}
.box-left:hover {
  .item-left-shadow {
    z-index: 99;
    opacity: 1;
  }
}
.img-box-items:hover {
  .item-left-p-shadow {
    z-index: 99;
    opacity: 1;
  }
}
.box-right {
  flex: 1;
}
.left-title1 {
  width: 100%;
  text-overflow: -o-ellipsis-lastline;
  line-height: 28px;
  overflow: hidden; //溢出内容隐藏
  text-overflow: ellipsis; //文本溢出部分用省略号表示
  display: -webkit-box; //特别显示模式
  -webkit-line-clamp: 2; //行数
  line-clamp: 2;
  -webkit-box-orient: vertical; //盒子中内容竖直排列
}
.title-left-style {
  display: flex;
}
</style>
